package org.springside.examples.miniservice.ws.user.dto;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.springside.examples.miniservice.ws.Constants;
/**
 * Web Service传输Role信息的DTO.
 * 
 * 分离entity类与web service接口间的耦合，隔绝entity类的修改对接口的影响.
 * 使用JAXB 2.0的annotation标注JAVA-XML映射,尽量使用默认约定.
 * 
 * @author calvin
 */
@XmlType(name = "Role", namespace = Constants.NS)
public class RoleDTO {
	private Integer id;

	private String name;

	@XmlElement(required = true)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

}
